home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_elevcontrol.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  122 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_ChapelDoor.cog
  4. #
  5. #
  6. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  7. #
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        startup
  13.     message     blocked
  14.     message        arrivedwpnt
  15.     message        user0
  16.  
  17.     keyframe    in_pull=in_pull_lever_down.key    local
  18.     keyframe    lever_down=gen_lever.key        local
  19.     keyframe    elevanim=inf_elvtr_gears.key    local
  20.     keyframe    elevanimup=inf_elvtr_gearup.key    local
  21.           
  22.     sound       leverpull=nub_lever_pull_c.wav  local   
  23.     sound       leverback=nub_lever_reset_c.wav local
  24.     sound       gearplatmove=nub_weight_move_c.wav  local
  25.     sound       gearplatstart=nub_elev_start_c.wav  local
  26.     sound       gearplatstop=nub_elev_stop_c.wav    local   
  27.  
  28.     thing        player                            local
  29.  
  30.     thing        camera
  31.     thing       camera_tgt0
  32.     thing       elevator
  33.     thing       elevator_cap
  34.     
  35.     thing       waypoint0
  36.     thing       waypoint1
  37.     
  38.     int         keychan                         local
  39.     int         movechan                        local
  40.     int         nextframe=0                     local
  41.     int         direction=0                     local
  42.     int         screen=0                        local
  43.     int         crntWpnt                        local
  44.     int         nextWpnt                        local
  45.     int         direction=0                     local
  46.  
  47. end
  48.  
  49. # ================================================================================
  50.  
  51. code
  52.  
  53. # ................................................................................
  54.  
  55. startup:
  56.  
  57.     AISetCutsceneMode(elevator);
  58.     player = GetLocalPlayerThing();
  59.     SetCollideType(elevator, 0);
  60.     ClearThingFlags(elevator, 0x80000);
  61.     
  62. return;
  63.  
  64. # ................................................................................
  65.  
  66. user0:
  67.  
  68.     AttachThingtoThing(elevator_cap, elevator);
  69.  
  70.     AISetWpnt(waypoint0, 2);
  71.     AISetWpnt(waypoint1, 3);
  72.     
  73.     AIConnectWpnts(2, 3);
  74.     
  75.     AITraverseWpnts(elevator, 2, 0.5, 0, 1);
  76.     keychan = PlayKey(elevator, elevanimup, 2, 0x00, 0);
  77.     movechan = PlaySoundThing(gearplatmove, elevator, 1, 5, 10, 1);
  78.     direction = 1;
  79.     
  80. return;
  81.  
  82. # ................................................................................
  83.  
  84. arrivedwpnt:
  85.  
  86.     if (GetSenderRef() == elevator)
  87.     {
  88.         //print("arriving at waypoint");
  89.         PlaySoundThing(gearplatstop, elevator, 1, 5, 10, 0);
  90.         StopSound(movechan, 0.0);
  91.         StopKey(elevator, keychan, 0);
  92.         
  93.         if (direction == 0)
  94.         {
  95.             keychan = PlayKey(elevator, elevanim, 2, 0x00, 0);
  96.             movechan = PlaySoundThing(gearplatmove, elevator, 1, 5, 10, 1);
  97.         }
  98.         if (direction == 1)
  99.         {
  100.             keychan = PlayKey(elevator, elevanimup, 2, 0x00, 0);
  101.             movechan = PlaySoundThing(gearplatmove, elevator, 1, 5, 10, 1);
  102.         }
  103.         
  104.         direction = 1-direction;
  105.     }
  106.         
  107. return;
  108.  
  109. # ................................................................................
  110.  
  111. blocked:
  112.  
  113.     //print("I'm blocked");
  114.     
  115. return;
  116.  
  117. # ................................................................................
  118.  
  119.  
  120. end
  121.  
  122.